package xyz.jfshare.netty.study.client.pojo;

import java.sql.Timestamp;
import java.util.Objects;

/**
 * @author YuJie_Jin
 * Description: 消息
 */
public class Message {
    /** id主键 */
    private Integer id;
    /** 发信者id */
    private Integer fromId;
    /** 收信者id */
    private Integer toId;
    /** 消息类型 1:用户消息 2:系统消息 */
    private Integer type;
    /** 消息内容 */
    private String content;
    /** 创建时间 */
    private Timestamp createTime;
    /** 修改时间 */
    private Timestamp updateTime;
    /** 是否已读 1:已读 0:未读 */
    private Integer isRead;
    /** 是否删除 1:已删除 0:未删除 */
    private Integer isDelete;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Message)) return false;
        Message message = (Message) o;
        return Objects.equals(getId(), message.getId()) &&
                Objects.equals(getFromId(), message.getFromId()) &&
                Objects.equals(getToId(), message.getToId()) &&
                Objects.equals(getType(), message.getType()) &&
                Objects.equals(getContent(), message.getContent()) &&
                Objects.equals(getCreateTime(), message.getCreateTime()) &&
                Objects.equals(getUpdateTime(), message.getUpdateTime()) &&
                Objects.equals(getIsRead(), message.getIsRead()) &&
                Objects.equals(getIsDelete(), message.getIsDelete());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getId(), getFromId(), getToId(), getType(), getContent(), getCreateTime(), getUpdateTime(), getIsRead(), getIsDelete());
    }

    @Override
    public String toString() {
        return "Message{" +
                "id=" + id +
                ", fromId=" + fromId +
                ", toId=" + toId +
                ", type=" + type +
                ", content='" + content + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", isRead=" + isRead +
                ", isDelete=" + isDelete +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getFromId() {
        return fromId;
    }

    public void setFromId(Integer fromId) {
        this.fromId = fromId;
    }

    public Integer getToId() {
        return toId;
    }

    public void setToId(Integer toId) {
        this.toId = toId;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getIsRead() {
        return isRead;
    }

    public void setIsRead(Integer isRead) {
        this.isRead = isRead;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }
}
